package com.ccz.demo;

public enum PriceCategoryEnum {
    CATEGORY_ADULTS("成人","成人价","成人数"),
    CATEGORY_TEENAGERS("青少年","青少年价","青少年数"),
    CATEGORY_CHILDREN("儿童","儿童价","儿童数"),
    CATEGORY_OLD_MAN("老人","老人价","老人数"),
    CATEGORY_BABY("婴儿","婴儿价","婴儿数");

    private String priceCategory;
    private String categoryPrice;
    private String categoryNum;


    private PriceCategoryEnum(String priceCategory, String categoryPrice, String categoryNum){
        this.categoryNum=categoryNum;
        this.priceCategory=priceCategory;
        this.categoryPrice=categoryPrice;
    }

    public String getPriceCategory() {
        return priceCategory;
    }

    public String getCategoryPrice() {
        return categoryPrice;
    }

    public String getCategoryNum() {
        return categoryNum;
    }

    public static String getCategoryPrice(String priceCategory){
        String categoryPrice= "";
        for (PriceCategoryEnum priceCategoryEnum : PriceCategoryEnum.values()) {
            if(priceCategoryEnum.priceCategory.equals(priceCategory )){
                categoryPrice=priceCategoryEnum.categoryPrice;
                break;
            }
        }
        return categoryPrice;
    }

    public static  String getCategoryNum(String priceCategory){
        String categoryNum= "";
        for (PriceCategoryEnum priceCategoryEnum : PriceCategoryEnum.values()) {
            if(priceCategoryEnum.priceCategory.equals(priceCategory )){
                categoryNum=priceCategoryEnum.categoryNum;
                break;
            }
        }
        return categoryNum;
    }

}
